package com.pyo.tcp.namecard;

import java.util.ArrayList;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class NameCardListActivity extends Activity {

	public static final String PARAM = "LIST";
	ListView list;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_name_card_list);
		Intent i = getIntent();
		ArrayList<NameCard> arr = (ArrayList<NameCard>)i.getSerializableExtra(PARAM);
		
		list = (ListView) findViewById(R.id.listView1);
		ArrayAdapter<NameCard> arr_adapter = new ArrayAdapter<NameCard>(this, android.R.layout.simple_list_item_1, arr);
		list.setAdapter(arr_adapter);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_name_card_list, menu);
		return true;
	}

}
